<template>
  <div class="">
    <dk-table ref="DkTableRef" :table-api="tableApi" :cache-table="!getDev()" :table-before="tableBefore" :hide-buttons="['recycle']">
      <template #emoji="{ row }">
        <div class="size-40px flex justify-center items-center text-36px">{{ row.emoji }}</div>
      </template>
    </dk-table>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { getDev } from '@/utils/auth'

defineOptions({
  name: 'RouteTagList'
})
const DkTableRef = ref()
const tableApi = '/gs_gold/admin.route_tag'
const props = defineProps({
  groupId: {
    default: 0,
    type: Number
  }
})

const tableBefore = ref({
  api: () => {
    DkTableRef.value.DkTable.api.configureRequest({
      params: {
        groupId: props.groupId
      }
    })
  },
  onTableHeaderAction: () => {
    const actionUrl = DkTableRef.value.DkTable.api.actionUrl
    actionUrl.set('form', tableApi + '/form?groupId=' + props.groupId)
  },
  onTableAction: () => {
    const actionUrl = DkTableRef.value.DkTable.api.actionUrl
    actionUrl.set('form', tableApi + '/form?groupId=' + props.groupId)
  }
})
</script>
<style></style>
